package com.fenghongzhang.day016;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Application;
import android.os.Bundle;
import android.widget.TextView;

import java.util.Map;

public class Main2Activity extends AppCompatActivity {
    private TextView txt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);


        txt = (TextView) findViewById(R.id.txt);




        MyApp myApp = (MyApp) getApplication();
        String name = myApp.name;

        Map<String, Object> stringObjectMap = myApp.list.get(0);
        Object name1 = stringObjectMap.get("name");
        txt.setText(name);

    }
}
